// source --> https://persianasdelicias.com/wp-content/plugins/ddpro/js/ddp-admin.js?ver=5.5
var ddd_full_stop = 0;
var json_counters_array = [];
jQuery(document).ready(function(e) {
// clipboard for report
e("#ddp-success-report").hide(),
new Clipboard("#ddp-copy-report").on("success", function() {
e("#ddp-success-report").show();
});
jQuery('.wrap.ddp-assistant:not(.activated) a.nav-tab:not(.divi_den_pro_dashboard):not(.ddp_assistant_system_status):not(.ddp_assistant_help_faq):not(.ddp_start_here)').addClass('disabled');
jQuery('table.ddp-report-table td a, table.ddp-report-table th a').on('click touch', function(event) {
event.preventDefault();
});
jQuery('#wp-ddp_wp_content-wrap').appendTo('tr#wp-ddp-column td');
setTimeout(function() { jQuery('.ddp-assistant>h1').insertBefore('h2.nav-tab-wrapper'); }, 100);
function ddp_get_tinymce_content() {
if (jQuery(".ddp_wl_settings #wp-content-wrap").hasClass("tmce-active")) {
return tinyMCE.activeEditor.getContent();
} else {
return jQuery('#html_text_area_id').val();
}
}
if (jQuery('.form-table.ddp_wl label input[name=ddp_plugin_name]').length > 0) {
ddp_n = $('.form-table.ddp_wl label input[name=ddp_plugin_name]').val();
ddp_n = ddp_n.replace(/\s+/g, '_').toLowerCase();
ddp_url_path = window.location.pathname;
$('.new_admin_url').html(window.location.protocol + '//' + window.location.hostname + ddp_url_path + '?page=' + ddp_n + '_dashboard_wl');
}
jQuery('.form-table.ddp_wl label input[name=ddp_plugin_name]').on('keyup', function() {
ddp_n = $(this).val();
ddp_n = ddp_n.replace(/\s+/g, '_').toLowerCase();
ddp_url_path = window.location.pathname;
$('.new_admin_url').html(window.location.protocol + '//' + window.location.hostname + ddp_url_path + '?page=' + ddp_n + '_dashboard_wl');
});
// WL Submit Button
jQuery('p.submit.ddp_wl.save_settings input').on('click touch', function(event) {
event.preventDefault();
ddd_full_stop = 0;
jQuery('.form-table.ddp_wl label input, .form-table.ddp_wl label textarea, #wp-ddp_wp_content-wrap').each(function() {
//if($('input#ddp_wl').is(":checked")) {
if ($(this).attr('id') !== 'wp-ddp_wp_content-wrap' && $(this).attr('name') !== 'ddp_plugin_icon') {
if ($(this).val() === '') {
ddd_full_stop = 1;
$(this).addClass('not-filled');
$(this).siblings('.ddp-error-message').remove();
$(this).after('This field is required')
}
// else {ddd_full_stop = 0;
// $(this).removeClass('not-filled');
// $(this).siblings('.ddp-error-message').remove();}
}
// }
});
if (ddd_full_stop === 0) {
$(this).next().hide();
jQuery('.form-table.ddp_wl label input, .form-table.ddp_wl label textarea, #wp-ddp_wp_content-wrap').each(function() {
if ($(this).attr('id') === 'wp-ddp_wp_content-wrap') {
ajax_option = 'ddp_wp_content';
ajax_val = tinyMCE.activeEditor.getContent();
} else {
ajax_option = $(this).attr('name');
ajax_val = $(this).val();
}
if (ajax_option === 'ddp_plugin_name') {
var new_name = ajax_val;
var new_link = ajax_val.replace(/\s+/g, '_').toLowerCase();
if (jQuery('input[name=ddp_wl]').is(":checked")) { redirect_link = window.location.pathname + '?page=' + new_link + '_dashboard_wl&tab=ddp_wl' } else redirect_link = window.location.pathname + '?page=divi_den_pro_dashboard&tab=ddp_wl';
if (jQuery('input[name=ddp_hide_menu]').is(":checked")) {
redirect_link = window.location.pathname.replace('admin.php', '');
}
}
//if ( ddd_full_stop === 0) {
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: 'action=ddp_update_option&ddp_option=' + ajax_option + '&ddp_option_val=' + ajax_val,
success: function(data) {
if (redirect_link) window.location.replace(redirect_link);
else window.location.reload();
},
error: function(data) {}
});
// }
});
} else { $(this).next().show(); }
});
jQuery('p input#submit_wl.submit_wl_disabled,p input#submit_wl.submit_wl_enabled').on('click', function(event) {
event.preventDefault();
ddd_full_stop = 0;
jQuery('.form-table.ddp_wl label input, .form-table.ddp_wl label textarea, #wp-ddp_wp_content-wrap').each(function() {
//if($('input#ddp_wl').is(":checked")) {
if ($(this).attr('id') !== 'wp-ddp_wp_content-wrap' && $(this).attr('name') !== 'ddp_plugin_icon') {
if ($(this).val() === '') {
ddd_full_stop = 1;
$(this).addClass('not-filled');
$(this).siblings('.ddp-error-message').remove();
$(this).after('This field is required')
}
// else {ddd_full_stop = 0;
// $(this).removeClass('not-filled');
// $(this).siblings('.ddp-error-message').remove();}
}
// }
});
if (ddd_full_stop === 0) {
$(this).next().hide();
$('.ddp_wl_hidden .et-box-content .et_pb_button_slider').click();
$('.submit.ddp_wl.save_settings input').click();
} else { $(this).next().show(); }
});
});
jQuery(document).ready(function($) {
$('#ddp-preview-window').insertAfter('body > :last-child');
jQuery.fn.center = function() {
this.css("position", "absolute");
this.css("top", (jQuery(window).height() - this.height()) / 2 + jQuery(window).scrollTop() + "px");
this.css("left", (jQuery(window).width() - this.width()) / 2 + jQuery(window).scrollLeft() + "px");
return this;
}
$('#ddp-preview').on('click', function() {
jQuery("#ddp-preview-window").center();
$('#ddp-preview-window').show();
});
$('#ddp-preview-close').on('click', function() {
$('#ddp-preview-window').hide();
});
// main function
function onIframeLoad() {
setTimeout(function() {
$('iframe#ondemanIframe').on('load', function() {
var frame = document.getElementById('ondemanIframe');
// remove divi loading animation
$('#et_pb_loading_animation').remove();
jQuery.ajax({
type: 'GET',
url: ajaxurl,
data: 'action=ddp_get_option',
success: function(data) {
var ddp_sp_enable = data + '';
if (ddp_sp_enable === 'enabled') { frame.contentWindow.postMessage('pro_membership_activated', '*'); } else { frame.contentWindow.postMessage('pro_membership_deactivated', '*'); }
}
});
// function to get post id from the url parameter 'post'
function getUrlVars() {
var vars = [],
hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++) {
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
var post_id = getUrlVars()["post"];
// Create IE + others compatible event handler
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent";
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message";
// Show featured images for sections - backend divi builder
if ($('ul.et_pb_saved_layouts_list').length > 0) {
$('ul.et_pb_saved_layouts_list li:not(.added_image)').each(function() {
this_title = $(this).find('a').text();
this_class = this_title.replace(/-+/g, '').replace(/\s+/g, '-').toLowerCase();
$(this).addClass(this_class);
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: 'action=ddp_show_featured_image&ddp_title_image=' + this_title,
success: function(data) {
if (data !== '') {
img_link = data.substring(data.indexOf("|") + 1);
img_post_title = data.replace(img_link, '').replace('|', '');
$('ul.et_pb_saved_layouts_list li:not(.with-image)').each(function() {
this_title = $(this).find('a').text();
if (this_title === img_post_title) {
$(this).find('a').before('');
$(this).addClass('with-image');
}
});
}
},
error: function(data) {
}
});
$(this).addClass('added_image');
});
//$('ul.et_pb_saved_layouts_list').addClass('ddp_images_sent');
}
// Show featured images for sections - visual divi builder
setInterval(function() {
if ($('div.et-fb-settings-options-tab-modules_library ul:not(.ddp_images_sent)').length > 0) {
$('div.et-fb-settings-options-tab-modules_library ul li:not(.added_image):not(.with-image)').each(function() {
this_title = $(this).find('span.et_module_title').text().trim();
this_class = this_title.replace(/-+/g, '').replace(/\s+/g, '-').toLowerCase();
$(this).addClass(this_class);
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: 'action=ddp_show_featured_image&ddp_title_image=' + this_title,
success: function(data) {
if (data !== '') {
img_link = data.substring(data.indexOf("|") + 1);
img_post_title = data.replace(img_link, '').replace('|', '');
$('div.et-fb-settings-options-tab-modules_library ul li:not(.with-image)').each(function() {
this_title = $(this).find('span.et_module_title').text().trim();
if (this_title === img_post_title && $(this).find('img.ddp_preview').length === 0) {
$(this).find('span.et_module_title').after('');
$(this).addClass('with-image');
}
});
}
},
error: function(data) {}
});
$(this).addClass('added_image');
});
//$('div.et-fb-settings-options-tab-modules_library ul').addClass('ddp_images_sent');
}
}, 1000);
var global_json_counter = 0;
var json_counter = 0;
// Listen to message from child window
eventer(messageEvent, function(e) {
if (e.origin === 'https://ondemand.divi-den.com') {
var response;
if (jQuery.type(e.data) === 'string') { // check if the response is text
if (~e.data.indexOf('context')) { // if the response is a divi json file
var ddp_replace_content = 'off';
// if (jQuery('.ddp-replace-content input').attr("checked") === 'checked') {
// ddp_replace_content = 'on';
// }
if (jQuery('#et_pb_main_container > .et_pb_section .et_pb_module_block').length <= 0) {
ddp_replace_content = 'on';
}
response = jQuery.parseJSON(e.data);
if (response) {
if (!$(frame).hasClass('settingsIframe') && !$(frame).hasClass('vbIframe') && response.context == 'et_builder') {
// console.log('LOADING LAYOUT');
layout = JSON.stringify(response);
//console.log('layout');
//console.log(layout);
var ddp_list = jQuery('.et-pb-all-modules-tab .et-pb-load-layouts');
var ddp_li = ddp_list.children('li').last().clone(true);
ddp_li.addClass('layout_here');
ddp_li.appendTo(ddp_list);
jQuery('.layout_here').data('layout_id', { layout: layout, replace_content: ddp_replace_content });
jQuery('.layout_here .et_pb_layout_button_load').click();
} else if (response.context == 'et_builder_layouts' || $(frame).hasClass('settingsIframe')) {
response_data = encodeURIComponent(JSON.stringify(response.data));
// import to library
// console.log('IMPORT');
jQuery.ajax({
type: 'POST',
url: ajaxurl,
// processData: false,
data: 'action=ddp_import_posts&posts=' + response_data,
success: function(data) {
if ($("div.sectionSaved").length === 0) {
$('.ddp-tab-section, .ddp-tab-module').html('
\
Success! Your section/module is being saved to your local Divi library.
\
Choose your next step...
\
1. Find new modules and save to your library
\
Find New Pro Modules\
2. Begin editing - Use the "Add From Library" tab to load sections/modules from local Divi Library
\
To Continue - Save and Reload Page\
(please do it manually if you are in Divi Visual Builder)\
');
$('body .ddp-tab-section a.ddp_reload, body .ddp-tab-module a.ddp_reload').on('click', function(e) {
e.preventDefault();
$('div.sectionSaved').html('Reloading...
');
$('input.button-primary#publish').click();
$('button.et-fb-button--publish').click();
$('li#wp-admin-bar-et-disable-visual-builder a.ab-item').click();
});
var ddp_rand = Math.floor((Math.random() * 1000000) + 1);
if (ddp_wl_options_for_js.ddp_status === 'enabled') {
ddp_sections_link = 'https://ondemand.divi-den.com/sections-search-api-ljljdfre935/?uid=' + ddp_rand;
ddp_modules_link = 'https://ondemand.divi-den.com/modules-search-api-fdge43y/?uid=' + ddp_rand;
} else {
ddp_sections_link = 'https://ondemand.divi-den.com/sections-search-no-api-asdfv324/?uid=' + ddp_rand;
ddp_modules_link = 'https://ondemand.divi-den.com/modules-search-no-api-33jwer3/?uid=' + ddp_rand;
}
$('body .ddp-tab-section a.ddp_close').on('click', function(e) {
e.preventDefault();
$('div.sectionSaved').html('Loading...
');
$('.ddp-tab-section').html('');
onIframeLoad();
});
$('body .ddp-tab-module a.ddp_close').on('click', function(e) {
e.preventDefault();
$('div.sectionSaved').html('Loading...
');
$('.ddp-tab-module').html('');
onIframeLoad();
});
}
$('body .ddp-assistant .loaded_message').show();
setTimeout(function() {
$('body .ddp-assistant .loaded_message').hide();
}, 5500);
},
error: function(data) {
console.log(data);
}
});
} // if(response.context == 'et_builder_layouts')
} // if (response)
} // if (~e.data.indexOf('context'))
else if (~e.data.indexOf('.')) { // if the response is a css file
console.log('CSS');
$('input#_et_pb_custom_css').val(e.data);
} else if (~e.data.indexOf(',jpg') || ~e.data.indexOf(',png')) { //a featured image link
console.log('IMAGE');
ddp_featured_image_url = e.data.replace(/\,/g, '.')
setTimeout(function() {
jQuery.ajax({
type: 'POST',
url: ajaxurl,
// processData: false,
data: 'action=ddp_import_featured_image&ddp_featured_image=' + ddp_featured_image_url,
success: function(data) {},
error: function(data) {}
});
}, 1000); //setTimeout(function(){
}
} //if jQuery.type(e.data) === 'string'
} //if (e.origin === 'https://ondemand.divi-den.com') {
}, false); // eventer(messageEvent, function(e) {
}); // $('iframe#ondemanIframe').on('load', function()
}, 200);
}
//function onIframeLoad()
$('body .ddp-assistant .loaded_message span.close').on('click', function() {
$('body .ddp-assistant .loaded_message').hide();
});
jQuery(document).on('keyup', function(evt) {
if (evt.keyCode == 27) {
//console.log('Escape pressed');
$('body .ddp-assistant .loaded_message').hide();
}
});
if (typeof ajaxurl === 'undefined') { ajaxurl = ddp_wl_options_for_js.ddp_ajax_url; }
if($('body').hasClass('et-fb') || $('body').hasClass('wp-admin')) {
// isert Divi Den Pro Tabs to Divi builder
jQuery.ajax({
type: 'GET',
url: ajaxurl,
data: 'action=ddp_get_option_wl',
success: function(data) {
var ddp_enable = data + '';
if (ddp_enable === 'disabled') { // check if the DDD is enabled in settings
onIframeLoad(); // our main function
// Insert layout from library
$(document).on('mouseup', '.et-pb-layout-buttons-load', function() {
setTimeout(function() {
var ddp_rand = Math.floor((Math.random() * 1000000) + 1);
if (ddp_wl_options_for_js.ddp_status === 'enabled') {
ddp_layouts_link = 'https://ondemand.divi-den.com/new-api-layouts-search-ghaser65/?uid=' + ddp_rand;
} else {
ddp_layouts_link = 'https://ondemand.divi-den.com/new-no-api-layouts-search-dngfh4q2/?uid=' + ddp_rand;
}
var tabbar = $('.et-pb-saved-modules-switcher');
if (ddp_wl_options_for_js.ddp_plugin_setting_tab_position === 'on') {
if (tabbar.length) {
tabbar.append(' ' + ddp_wl_options_for_js.ddp_wl_pn_for_js + '');
$(".et_pb_modal_settings").append('\
\
Important: if you\'re replacing the content, please manually clear the layout and update the page, then load the new layout.
\
');
}
} else {
$('li.et-pb-options-tabs-links-active').removeClass('et-pb-options-tabs-links-active');
$('div.active-container').removeClass('active-container').css('opacity', 0);
tabbar.prepend(' ' + ddp_wl_options_for_js.ddp_wl_pn_for_js + '');
$(".et_pb_modal_settings").append('\
\
Important: if you\'re replacing the content, please manually clear the layout and update the page, then load the new layout.
\
');
}
}, 200);
onIframeLoad();
});
//Insert section from library
$(document).on('mouseup', '.et-pb-section-add-saved', function() {
setTimeout(function() {
jQuery('.et_pb_modal_settings.et_pb_modal_no_tabs').removeClass('et_pb_modal_no_tabs');
var ddp_rand = Math.floor((Math.random() * 1000000) + 1);
if (ddp_wl_options_for_js.ddp_status === 'enabled') {
ddp_sections_link = 'https://ondemand.divi-den.com/sections-search-api-ljljdfre935/?uid=' + ddp_rand;
} else ddp_sections_link = 'https://ondemand.divi-den.com/sections-search-no-api-asdfv324/?uid=' + ddp_rand;
if (ddp_wl_options_for_js.ddp_plugin_setting_tab_position === 'on') {
jQuery('.et_pb_modal_settings_container h3').after(' \
\
');
} // if ddp_wl_options_for_js.ddp_plugin_setting_tab_position
else {
$('li.et-pb-options-tabs-links-active').removeClass('et-pb-options-tabs-links-active');
$('div.active-container').removeClass('active-container').css('opacity', 0);
jQuery('.et_pb_modal_settings_container h3').after(' \
\
');
}
}, 200);
onIframeLoad();
});
//Insert modules from library
$(document).on('mouseup', '.et-pb-column .et-pb-insert-module', function() {
setTimeout(function() {
jQuery('.et_pb_modal_settings.et_pb_modal_no_tabs').removeClass('et_pb_modal_no_tabs');
var ddp_rand = Math.floor((Math.random() * 1000000) + 1);
if (ddp_wl_options_for_js.ddp_status === 'enabled') {
ddp_modules_link = 'https://ondemand.divi-den.com/modules-search-api-fdge43y/?uid=' + ddp_rand;
} else ddp_modules_link = 'https://ondemand.divi-den.com/modules-search-no-api-33jwer3/?uid=' + ddp_rand;
// $('li.et-pb-options-tabs-links-active').removeClass('et-pb-options-tabs-links-active');
// $('div.active-container').removeClass('active-container').css('opacity', 0);
$('.et-pb-options-tabs-links.et-pb-saved-modules-switcher').remove();
if (ddp_wl_options_for_js.ddp_plugin_setting_tab_position === 'on') {
jQuery('.et_pb_modal_settings_container h3').after(' \
\
\
');
} else {
// $('.et-pb-options-tabs-links.et-pb-saved-modules-switcher').remove();
$('li.et-pb-options-tabs-links-active').removeClass('et-pb-options-tabs-links-active');
$('div.active-container').removeClass('active-container').css('opacity', 0);
jQuery('.et_pb_modal_settings_container h3').after(' \
\
\
');
}
}, 200);
onIframeLoad();
});
setInterval(function() {
// VISUAL BUILDER SECTIONS and MODULES
if (($('a.modules_all').text() == 'New Section' || $('a.modules_all').text() == 'New Module') && $('.ddp').length <= 0) {
$('#et-fb-settings-column').css('overflow', 'hidden');
var ddp_rand = Math.floor((Math.random() * 1000000) + 1);
if (ddp_wl_options_for_js.ddp_status === 'enabled') {
ddp_sections_link = 'https://ondemand.divi-den.com/sections-search-api-ljljdfre935/?uid=' + ddp_rand;
ddp_modules_link = 'https://ondemand.divi-den.com/modules-search-api-fdge43y/?uid=' + ddp_rand;
} else {
ddp_sections_link = 'https://ondemand.divi-den.com/sections-search-no-api-asdfv324/?uid=' + ddp_rand;
ddp_modules_link = 'https://ondemand.divi-den.com/modules-search-no-api-33jwer3/?uid=' + ddp_rand;
}
if (ddp_wl_options_for_js.ddp_plugin_setting_tab_position === 'on') {
$('a.modules_all').parents('.et-fb-settings-tabs-nav').append('\
' + ddp_wl_options_for_js.ddp_wl_pn_for_js + '');
if ($('a.modules_all').text() == 'New Section') {
$(".et-fb-settings-options-wrap > .et-fb-settings-options").append('\
');
}
if ($('a.modules_all').text() == 'New Module') {
$(".et-fb-settings-options-wrap > .et-fb-settings-options").append('\
');
}
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' width: 400px; min-height: auto; left: 38%;')
} else {
$('a.modules_all').parents('.et-fb-settings-tabs-nav').prepend('\
' + ddp_wl_options_for_js.ddp_wl_pn_for_js + '');
if ($('a.modules_all').text() == 'New Section') {
$(".et-fb-settings-options-wrap > .et-fb-settings-options").prepend('\
');
}
if ($('a.modules_all').text() == 'New Module') {
$(".et-fb-settings-options-wrap > .et-fb-settings-options").prepend('\
');
}
$(".ddp-tab-section").siblings('div').removeClass('et-fb-settings-options-tab--active');
$('.et-fb-settings-tabs-nav li.ddp a').parent('li').siblings().removeClass('et-fb-settings-tabs-nav-item--active');
$('.et-fb-settings-options-wrap').attr('style', 'max-height: 100% !important; max-height: 100% !important; height: 100% !important;');
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' width: 80%; min-height: 650px; left: 10%;')
$('.ddp').parents('.et-fb-settings-tabs-nav').addClass('ddp-tab-parent');
$('.ddp-tab-section').parents('div.et-fb-settings-options').removeClass('ddp-option-parent');
}
$('.et-fb-settings-options-wrap').attr('style', 'max-height: 100% !important; max-height: 100% !important; height: 100% !important;');
$('.et-fb-main-settings--add_new_module .et-fb-settings-tabs-nav li:not(.ddp) a').on('click', function() {
//console.log('Click on ather tab');
// $('li.et-fb-settings-tabs-nav-item--active').removeClass('et-fb-settings-tabs-nav-item--active');
$(".ddp-tab-section").removeClass('et-fb-settings-options-tab--active');
$(this).parent('li').siblings('li').removeClass('et-fb-settings-tabs-nav-item--active');
$(this).parent('li').addClass('et-fb-settings-tabs-nav-item--active');
$(this).parents('div.et-fb-settings-options').removeClass('ddp-option-parent');
$('.et-fb-settings-options-wrap').removeAttr('style');
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' width: 400px; min-height: auto; left: 38%;')
$(this).parents('.et-fb-settings-tabs-nav').removeClass('ddp-tab-parent');
});
$('.et-fb-main-settings--add_new_module .et-fb-settings-tabs-nav li.ddp a').on('click', function(e) {
e.preventDefault();
//console.log('Click on DDP');
$(this).parent('li').siblings().removeClass('et-fb-settings-tabs-nav-item--active');
$(".ddp-tab-section").siblings('div').removeClass('et-fb-settings-options-tab--active');
$(this).parent('li').addClass('et-fb-settings-tabs-nav-item--active');
$(".ddp-tab-section").addClass('et-fb-settings-options-tab--active');
$(".ddp-tab-section").parents('div.et-fb-settings-options-wrap').addClass('ddp-option-parent');
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' width: 80%; min-height: 650px; left: 10%;');
$('.et-fb-settings-options-wrap').attr('style', 'max-height: 100% !important; height: 100% !important;');
$(this).parents('.et-fb-settings-tabs-nav').addClass('ddp-tab-parent');
});
onIframeLoad();
}
if ($('.et-fb-module-settings li[data-open_tab="ddp-tab"]').length > 0) {
// console.log('styles ' + styles);
if (!$('.et-fb-module-settings li[data-open_tab="ddp-tab"]').hasClass('et-fb-settings-tabs-nav-item--active')) {
// console.log('Another tab');
var new_style = " width: 400px; min-height: auto; left: 38%;";
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
if (attr_style && ~attr_style.indexOf(new_style)) {
attr_style = attr_style.replace(/ width: 400px; min-height: auto; left: 38%;/, '');
attr_style = attr_style.replace(/ width: 80%; min-height: 650px; left: 10%;/g, '');
}
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + new_style);
$('.et-fb-settings-options-wrap').removeAttr('style');
$('.et-fb-settings-tabs-nav').removeClass('ddp-tab-parent');
this_tab_text = $('li.et-fb-settings-tabs-nav-item--active').text();
if (this_tab_text === 'New Section') {
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').show();
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').hide();
$('.et-fb-settings-options-wrap').attr('style', 'max-height: 130px !important; height: 100% !important;');
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
attr_style = attr_style.replace(/min-height: auto;/g, '');
attr_style = attr_style.replace(/min-height: 400px;/g, '');
if (attr_style && attr_style.indexOf('min-height: 130px') < 1)
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' min-height: 130px;')
}
if (this_tab_text === 'Add From Library') {
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').hide();
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').show();
$('.et-fb-settings-options-wrap').css('overflow-y', 'auto');
$('.et-fb-settings-options-wrap').attr('style', 'max-height: 500px !important; height: 100% !important;');
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
attr_style = attr_style.replace(/min-height: auto;/g, '');
attr_style = attr_style.replace(/min-height: 130px;/g, '');
if (attr_style && attr_style.indexOf('min-height: 400px') < 1)
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' min-height: 400px;')
}
if (this_tab_text === 'New Module') {
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').show();
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').hide();
$('.et-fb-settings-options-wrap').css('overflow-y', 'auto');
$('.et-fb-settings-options-wrap').attr('style', 'max-height: 500px !important; height: 100% !important;');
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
attr_style = attr_style.replace(/min-height: auto;/g, '');
attr_style = attr_style.replace(/min-height: 130px;/g, '');
if (attr_style && attr_style.indexOf('min-height: 400px') < 1)
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' min-height: 400px;')
}
} else {
// console.log('DDP tab');
var attr_style = $('a.modules_all').parents('#et-fb-settings-column').attr('style');
var new_style = " width: 80%; min-height: 650px; left: 10%;";
attr_style = attr_style.replace(/ width: 400px; min-height: auto; left: 38%;/g, '');
if (attr_style && ~attr_style.indexOf(new_style)) {
//attr_style = attr_style.replace(/ width: 400px; min-height: auto; left: 38%;/g, '');
attr_style = attr_style.replace(/ width: 80%; min-height: 650px; left: 10%;/, '');
}
// console.log('attr_style '+attr_style);
$('a.modules_all').parents('#et-fb-settings-column').attr('style', attr_style + ' width: 80%; min-height: 650px; left: 10%;')
$('.et-fb-settings-options-wrap').attr('style', 'max-height: 100% !important; min-height: 100% !important; height: 100% !important;');
$(this).parents('.et-fb-settings-tabs-nav').addClass('ddp-tab-parent');
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_all').hide();
$('.et-fb-settings-options-wrap .et-fb-settings-options .et-fb-settings-options-tab-modules_library').hide();
}
}
}, 500);
} else onIframeLoad(); //if (ddp_enable == 'enabled')
},
error: function(data) {}
}); // ajax
} //if($('body').hasClass('et-fb') || $('body').hasClass('wp-admin'))
setInterval(function() {
if ($('iframe#ondemandIframe.settingsIframe').length) {
// console.log('ondemandIframe.settingsIframe');
onIframeLoad();
}
}, 1000);
// Yes - No button UI
$('.ddp-assistant .yes_no_button').each(function() {
var $checkbox = $(this);
var value = $checkbox.is(':checked');
var state = value ? 'et_pb_on_state' : 'et_pb_off_state';
var $template = $($('#epanel-yes-no-button-template').html()).find('.et_pb_yes_no_button').addClass(state);
$checkbox.hide().after($template);
if ('et_pb_static_css_file' === $checkbox.attr('id')) {
$checkbox
.parent()
.addClass(state)
.next()
.addClass('et_pb_clear_static_css')
.on('click', function() {
epanel_clear_static_css(false, true);
});
if (!value) {
$checkbox.parents('.et-epanel-box').next().hide();
}
}
});
// Save settings button
$('.ddp_settings.save_settings input#submit').on('click', function(e) {
e.preventDefault();
$(".ddp-archive-settings .et-epanel-box select").each(function() {
var this_option = $(this).attr('id');
var this_val = $(this).val();
//console.log(this_option + " " + this_val);
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: 'action=ddp_update_option&ddp_option=' + this_option + '&ddp_option_val=' + this_val,
success: function(data) {
window.location.reload();
},
error: function(data) {}
});
});
});
// Enable / Disable ddp button
$('.ddp-assistant .et-box-content').on('click', '.et_pb_yes_no_button', function(e) {
e.preventDefault();
var $click_area = $(this),
$box_content = $click_area.parents('.et-box-content'),
$checkbox = $box_content.find('input[type="checkbox"]'),
$state = $box_content.find('.et_pb_yes_no_button');
$ddp_option = $box_content.find('input').attr('name');
$state.toggleClass('et_pb_on_state et_pb_off_state');
if ($checkbox.is(':checked')) {
$checkbox.prop('checked', false);
} else {
$checkbox.prop('checked', true);
}
if ($click_area.hasClass('et_pb_on_state')) {
ajax_value = 'enabled';
if ($click_area.hasClass('ddp_enable')) {
var ddp_rand = Math.floor((Math.random() * 1000000) + 1);
if (ddp_wl_options_for_js.ddp_status === 'enabled') {
ddp_layouts_link = 'https://ondemand.divi-den.com/new-api-layouts-search-ghaser65/?uid=' + ddp_rand;
} else {
ddp_layouts_link = 'https://ondemand.divi-den.com/new-no-api-layouts-search-dngfh4q2/?uid=' + ddp_rand;
}
$('').insertAfter('.ddp-assistant hr');
onIframeLoad();
}
} else {
ajax_value = 'disabled';
//if ($click_area.hasClass('ddp_enable')) { $('.ddp-assistant iframe#ondemanIframe').remove(); }
}
if (ddd_full_stop === 0) {
// update ddp enable / disable option
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: 'action=ddp_update_option&ddp_option=' + $ddp_option + '&ddp_option_val=' + ajax_value,
success: function(data) {},
error: function(data) {}
});
}
});
$('.ddp-accordion .ddp-accordion-header').click(function() {
//Expand or collapse this panel
$(this).next('.ddp-accordion-content').slideToggle('fast');
$(this).parent('.ddp-accordion').toggleClass('closed').toggleClass('opened');
$('.ddp-accordion.opened h3 span').html('-');
$('.ddp-accordion.closed h3 span').html('+');
//Hide the other panels
// $(".ddp-accordion-content").not($(this).next('.ddp-accordion-content')).slideUp('fast');
});
setTimeout(function() {
if ($('.ddp-assistant.activated h2.nav-tab-wrapper').length > 0) {
$('div[data-dismissible=disable-ddpro-cache-notice-forever]').insertAfter('.ddp-assistant.activated h2.nav-tab-wrapper');
$('div[data-dismissible=disable-ddpro-cache-notice-forever]').show();
}
}, 300);
setInterval(function() {
if ($('iframe#ondemanIframe').length > 0) {
$('div[data-dismissible=disable-ddpro-cache-notice-forever]:not(.shown)').insertBefore('iframe#ondemanIframe');
$('div[data-dismissible=disable-ddpro-cache-notice-forever]:not(.shown)').show();
$('div[data-dismissible=disable-ddpro-cache-notice-forever]').addClass('shown');
}
}, 100);
$('input[name="ddp_plugin_name"]').alphanum({
allowSpace: true, // Allow the space character
allowUpper: true // Allow Upper Case characters
});
// PLUGIN SETTING
// tap position
if ($("input#ddp_plugin_setting_tab_position").length > 0) {
jQuery.ajax({
type: 'GET',
url: ajaxurl,
data: 'action=ddp_get_option_ddp_plugin_setting_tab_position',
success: function(data) {
// console.log(data);
if ((data) === 'on') $("input#ddp_plugin_setting_tab_position").attr('checked', 'checked');
else $("input#ddp_plugin_setting_tab_position").removeAttr('checked');
},
error: function(data) {}
});
$("input#ddp_plugin_setting_tab_position").on('change', function() {
var this_option = $(this).attr('id');
if ($(this).attr('checked') === 'checked') $(this).val('on');
else $(this).val('off');
var this_val = $(this).val();
jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: 'action=ddp_update_option&ddp_option=' + this_option + '&ddp_option_val=' + this_val,
success: function(data) {
//console.log(this_option + ": " + this_val);
},
error: function(data) {}
});
}); // $("input#ddp-setting-tab-position").on
} //if( $("input#ddp_plugin_setting_tap_position").length > 0)
}); //jQuery(document).ready(function($);
// source --> https://persianasdelicias.com/wp-content/mu-plugins/1and1-wordpress-assistant/js/cookies.js?ver=5.5
function switchFeature( name ) {
var feature = getCookie( 'uialfred-assistant-config-' + name );
if ( ! feature || feature === '0' ) {
setCookie( 'uialfred-assistant-config-' + name, 1 );
} else {
setCookie( 'uialfred-assistant-config-' + name, 0 );
}
window.location.reload();
}
function setCookie( param, value, exdays ) {
var date = new Date();
date.setTime( date.getTime() + ( exdays * 24 * 60 * 60 * 1000 ) );
var expires = 'expires=' + date.toUTCString();
document.cookie = param + '=' + value + ';' + expires + ';path=/';
}
function getCookie( param ) {
var name = param + '=';
var cookie_list = document.cookie.split(';');
for ( var i = 0; i < cookie_list.length; i++ ) {
var cookie = cookie_list[i];
while ( cookie.charAt( 0 ) === ' ' ) {
cookie = cookie.substring( 1 );
}
if ( cookie.indexOf( name ) === 0 ) {
return cookie.substring( name.length, cookie.length );
}
}
return '';
};
// source --> https://persianasdelicias.com/wp-content/plugins/4divi-masonry-gallery/scripts/imagesloaded.pkgd.min.js?ver=1
/*!
* imagesLoaded PACKAGED v4.1.2
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
!function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var r=this._onceEvents&&this._onceEvents[t];o;){var s=r&&r[o];s&&(this.off(t,o),delete r[o]),o.apply(this,e),n+=s?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("ev-emitter")):t.imagesLoaded=e(t,t.EvEmitter)}("undefined"!=typeof window?window:this,function(t,e){function i(t,e){for(var i in e)t[i]=e[i];return t}function n(t){var e=[];if(Array.isArray(t))e=t;else if("number"==typeof t.length)for(var i=0;i https://persianasdelicias.com/wp-content/plugins/4divi-masonry-gallery/scripts/isotope.pkgd.min.js?ver=1
/*!
* Isotope PACKAGED v3.0.4
*
* Licensed GPLv3 for open source use
* or Isotope Commercial License for commercial use
*
* http://isotope.metafizzy.co
* Copyright 2017 Metafizzy
*/
!function(t,e){"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){return e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function u(t,e,o){var n,s="$()."+i+'("'+e+'")';return t.each(function(t,u){var h=a.data(u,i);if(!h)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var d=h[e];if(!d||"_"==e.charAt(0))return void r(s+" is not a valid method");var l=d.apply(h,o);n=void 0===n?l:n}),void 0!==n?n:t}function h(t,e){t.each(function(t,o){var n=a.data(o,i);n?(n.option(e),n._init()):(n=new s(o,e),a.data(o,i,n))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=n.call(arguments,1);return u(this,t,e)}return h(this,t),this},o(a))}function o(t){!t||t&&t.bridget||(t.bridget=i)}var n=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return o(e||t.jQuery),i}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}("undefined"!=typeof window?window:this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},o=i[t]=i[t]||[];return o.indexOf(e)==-1&&o.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},o=i[t]=i[t]||{};return o[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=i.indexOf(e);return o!=-1&&i.splice(o,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var o=0,n=i[o];e=e||[];for(var s=this._onceEvents&&this._onceEvents[t];n;){var r=s&&s[n];r&&(this.off(t,n),delete s[n]),n.apply(this,e),o+=r?0:1,n=i[o]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e1&&i+t>this.cols;i=o?0:i;var n=e.size.outerWidth&&e.size.outerHeight;return this.horizontalColIndex=n?i+t:this.horizontalColIndex,{col:i,y:this._getColGroupY(i,t)}},o._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this._getOption("originLeft"),s=n?o.left:o.right,r=s+i.outerWidth,a=Math.floor(s/this.columnWidth);a=Math.max(0,a);var u=Math.floor(r/this.columnWidth);u-=r%this.columnWidth?0:1,u=Math.min(this.cols-1,u);for(var h=this._getOption("originTop"),d=(h?o.top:o.bottom)+i.outerHeight,l=a;l<=u;l++)this.colYs[l]=Math.max(d,this.colYs[l])},o._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this._getOption("fitWidth")&&(t.width=this._getContainerFitWidth()),t},o._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!=this.containerWidth},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode"),require("masonry-layout")):e(t.Isotope.LayoutMode,t.Masonry)}(window,function(t,e){"use strict";var i=t.create("masonry"),o=i.prototype,n={_getElementOffset:!0,layout:!0,_getMeasurement:!0};for(var s in e.prototype)n[s]||(o[s]=e.prototype[s]);var r=o.measureColumns;o.measureColumns=function(){this.items=this.isotope.filteredItems,r.call(this)};var a=o._getOption;return o._getOption=function(t){return"fitWidth"==t?void 0!==this.options.isFitWidth?this.options.isFitWidth:this.options.fitWidth:a.apply(this.isotope,arguments)},i}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("fitRows"),i=e.prototype;return i._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},i._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},i._getContainerSize=function(){return{height:this.maxY}},e}),function(t,e){"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof module&&module.exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window,function(t){"use strict";var e=t.create("vertical",{horizontalAlignment:0}),i=e.prototype;return i._resetLayout=function(){this.y=0},i._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},i._getContainerSize=function(){return{height:this.y}},e}),function(t,e){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","desandro-matches-selector/matches-selector","fizzy-ui-utils/utils","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],function(i,o,n,s,r,a){return e(t,i,o,n,s,r,a)}):"object"==typeof module&&module.exports?module.exports=e(t,require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("fizzy-ui-utils"),require("isotope/js/item"),require("isotope/js/layout-mode"),require("isotope/js/layout-modes/masonry"),require("isotope/js/layout-modes/fit-rows"),require("isotope/js/layout-modes/vertical")):t.Isotope=e(t,t.Outlayer,t.getSize,t.matchesSelector,t.fizzyUIUtils,t.Isotope.Item,t.Isotope.LayoutMode)}(window,function(t,e,i,o,n,s,r){function a(t,e){return function(i,o){for(var n=0;na||ra?1:-1)*h}}return 0}}var u=t.jQuery,h=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},d=e.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=s,d.LayoutMode=r;var l=d.prototype;l._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),e.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var t in r.modes)this._initLayoutMode(t)},l.reloadItems=function(){this.itemGUID=0,e.prototype.reloadItems.call(this)},l._itemize=function(){for(var t=e.prototype._itemize.apply(this,arguments),i=0;i https://persianasdelicias.com/wp-content/plugins/4divi-masonry-gallery/scripts/packery.pkgd.min.js?ver=1
if (navigator.userAgent.match(/instagram/i)) {
// Instagram browser
}
else
{
/*!
* Packery PACKAGED v2.1.1
* Gapless, draggable grid layouts
*
* Licensed GPLv3 for open source use
* or Packery Commercial License for commercial use
*
* http://packery.metafizzy.co
* Copyright 2016 Metafizzy
*/
!function(t,e){"use strict";"function"==typeof define&&define.amd?define("jquery-bridget/jquery-bridget",["jquery"],function(i){e(t,i)}):"object"==typeof module&&module.exports?module.exports=e(t,require("jquery")):t.jQueryBridget=e(t,t.jQuery)}(window,function(t,e){"use strict";function i(i,s,a){function h(t,e,n){var o,s="$()."+i+'("'+e+'")';return t.each(function(t,h){var u=a.data(h,i);if(!u)return void r(i+" not initialized. Cannot call methods, i.e. "+s);var c=u[e];if(!c||"_"==e.charAt(0))return void r(s+" is not a valid method");var d=c.apply(u,n);o=void 0===o?d:o}),void 0!==o?o:t}function u(t,e){t.each(function(t,n){var o=a.data(n,i);o?(o.option(e),o._init()):(o=new s(n,e),a.data(n,i,o))})}a=a||e||t.jQuery,a&&(s.prototype.option||(s.prototype.option=function(t){a.isPlainObject(t)&&(this.options=a.extend(!0,this.options,t))}),a.fn[i]=function(t){if("string"==typeof t){var e=o.call(arguments,1);return h(this,t,e)}return u(this,t),this},n(a))}function n(t){!t||t&&t.bridget||(t.bridget=i)}var o=Array.prototype.slice,s=t.console,r="undefined"==typeof s?function(){}:function(t){s.error(t)};return n(e||t.jQuery),i}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("get-size/get-size",[],function(){return e()}):"object"==typeof module&&module.exports?module.exports=e():t.getSize=e()}(window,function(){"use strict";function t(t){var e=parseFloat(t),i=-1==t.indexOf("%")&&!isNaN(e);return i&&e}function e(){}function i(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;u>e;e++){var i=h[e];t[i]=0}return t}function n(t){var e=getComputedStyle(t);return e||a("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),e}function o(){if(!c){c=!0;var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style.boxSizing="border-box";var i=document.body||document.documentElement;i.appendChild(e);var o=n(e);s.isBoxSizeOuter=r=200==t(o.width),i.removeChild(e)}}function s(e){if(o(),"string"==typeof e&&(e=document.querySelector(e)),e&&"object"==typeof e&&e.nodeType){var s=n(e);if("none"==s.display)return i();var a={};a.width=e.offsetWidth,a.height=e.offsetHeight;for(var c=a.isBorderBox="border-box"==s.boxSizing,d=0;u>d;d++){var f=h[d],l=s[f],p=parseFloat(l);a[f]=isNaN(p)?0:p}var g=a.paddingLeft+a.paddingRight,m=a.paddingTop+a.paddingBottom,y=a.marginLeft+a.marginRight,v=a.marginTop+a.marginBottom,_=a.borderLeftWidth+a.borderRightWidth,x=a.borderTopWidth+a.borderBottomWidth,b=c&&r,E=t(s.width);E!==!1&&(a.width=E+(b?0:g+_));var T=t(s.height);return T!==!1&&(a.height=T+(b?0:m+x)),a.innerWidth=a.width-(g+_),a.innerHeight=a.height-(m+x),a.outerWidth=a.width+y,a.outerHeight=a.height+v,a}}var r,a="undefined"==typeof console?e:function(t){console.error(t)},h=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],u=h.length,c=!1;return s}),function(t,e){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",e):"object"==typeof module&&module.exports?module.exports=e():t.EvEmitter=e()}(this,function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var i=this._events=this._events||{},n=i[t]=i[t]||[];return-1==n.indexOf(e)&&n.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var i=this._onceEvents=this._onceEvents||{},n=i[t]=i[t]||{};return n[e]=!0,this}},e.off=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=i.indexOf(e);return-1!=n&&i.splice(n,1),this}},e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(i&&i.length){var n=0,o=i[n];e=e||[];for(var s=this._onceEvents&&this._onceEvents[t];o;){var r=s&&s[o];r&&(this.off(t,o),delete s[o]),o.apply(this,e),n+=r?0:1,o=i[n]}return this}},t}),function(t,e){"use strict";"function"==typeof define&&define.amd?define("desandro-matches-selector/matches-selector",e):"object"==typeof module&&module.exports?module.exports=e():t.matchesSelector=e()}(window,function(){"use strict";var t=function(){var t=Element.prototype;if(t.matches)return"matches";if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0;i=t.x+e&&this.y+this.height>=t.y+i},e.overlaps=function(t){var e=this.x+this.width,i=this.y+this.height,n=t.x+t.width,o=t.y+t.height;return this.xt.x&&this.yt.y},e.getMaximalFreeRects=function(e){if(!this.overlaps(e))return!1;var i,n=[],o=this.x+this.width,s=this.y+this.height,r=e.x+e.width,a=e.y+e.height;return this.yr&&(i=new t({x:r,y:this.y,width:o-r,height:this.height}),n.push(i)),s>a&&(i=new t({x:this.x,y:a,width:this.width,height:s-a}),n.push(i)),this.x=t.width&&this.height>=t.height},t}),function(t,e){if("function"==typeof define&&define.amd)define("packery/js/packer",["./rect"],e);else if("object"==typeof module&&module.exports)module.exports=e(require("./rect"));else{var i=t.Packery=t.Packery||{};i.Packer=e(i.Rect)}}(window,function(t){"use strict";function e(t,e,i){this.width=t||0,this.height=e||0,this.sortDirection=i||"downwardLeftToRight",this.reset()}var i=e.prototype;i.reset=function(){this.spaces=[];var e=new t({x:0,y:0,width:this.width,height:this.height});this.spaces.push(e),this.sorter=n[this.sortDirection]||n.downwardLeftToRight},i.pack=function(t){for(var e=0;e=t.x+t.width&&i.height>=t.height-.01;if(n){t.y=i.y,this.placed(t);break}}},i.rowPack=function(t){for(var e=0;e=t.y+t.height&&i.width>=t.width-.01;if(n){t.x=i.x,this.placed(t);break}}},i.placeInSpace=function(t,e){t.x=e.x,t.y=e.y,this.placed(t)},i.placed=function(t){for(var e=[],i=0;ii&&1>n;return o?void this.goTo(t,e):void a.apply(this,arguments)},s.enablePlacing=function(){this.removeTransitionStyles(),this.isTransitioning&&n&&(this.element.style[n]="none"),this.isTransitioning=!1,this.getSize(),this.layout._setRectSize(this.element,this.rect),this.isPlacing=!0},s.disablePlacing=function(){this.isPlacing=!1},s.removeElem=function(){this.element.parentNode.removeChild(this.element),this.layout.packer.addSpace(this.rect),this.emitEvent("remove",[this])},s.showDropPlaceholder=function(){var t=this.dropPlaceholder;t||(t=this.dropPlaceholder=document.createElement("div"),t.className="packery-drop-placeholder",t.style.position="absolute"),t.style.width=this.size.width+"px",t.style.height=this.size.height+"px",this.positionDropPlaceholder(),this.layout.element.appendChild(t)},s.positionDropPlaceholder=function(){this.dropPlaceholder.style[n]="translate("+this.rect.x+"px, "+this.rect.y+"px)"},s.hideDropPlaceholder=function(){var t=this.dropPlaceholder.parentNode;t&&t.removeChild(this.dropPlaceholder)},o}),function(t,e){"function"==typeof define&&define.amd?define(["get-size/get-size","outlayer/outlayer","packery/js/rect","packery/js/packer","packery/js/item"],e):"object"==typeof module&&module.exports?module.exports=e(require("get-size"),require("outlayer"),require("./rect"),require("./packer"),require("./item")):t.Packery=e(t.getSize,t.Outlayer,t.Packery.Rect,t.Packery.Packer,t.Packery.Item)}(window,function(t,e,i,n,o){"use strict";function s(t,e){return t.position.y-e.position.y||t.position.x-e.position.x}function r(t,e){return t.position.x-e.position.x||t.position.y-e.position.y}function a(t,e){var i=e.x-t.x,n=e.y-t.y;return Math.sqrt(i*i+n*n)}i.prototype.canFit=function(t){return this.width>=t.width-1&&this.height>=t.height-1};var h=e.create("packery");h.Item=o;var u=h.prototype;u._create=function(){e.prototype._create.call(this),this.packer=new n,this.shiftPacker=new n,this.isEnabled=!0,this.dragItemCount=0;var t=this;this.handleDraggabilly={dragStart:function(){t.itemDragStart(this.element)},dragMove:function(){t.itemDragMove(this.element,this.position.x,this.position.y)},dragEnd:function(){t.itemDragEnd(this.element)}},this.handleUIDraggable={start:function(e,i){i&&t.itemDragStart(e.currentTarget)},drag:function(e,i){i&&t.itemDragMove(e.currentTarget,i.position.left,i.position.top)},stop:function(e,i){i&&t.itemDragEnd(e.currentTarget)}}},u._resetLayout=function(){this.getSize(),this._getMeasurements();var t,e,i;this._getOption("horizontal")?(t=1/0,e=this.size.innerHeight+this.gutter,i="rightwardTopToBottom"):(t=this.size.innerWidth+this.gutter,e=1/0,i="downwardLeftToRight"),this.packer.width=this.shiftPacker.width=t,this.packer.height=this.shiftPacker.height=e,this.packer.sortDirection=this.shiftPacker.sortDirection=i,this.packer.reset(),this.maxY=0,this.maxX=0},u._getMeasurements=function(){this._getMeasurement("columnWidth","width"),this._getMeasurement("rowHeight","height"),this._getMeasurement("gutter","width")},u._getItemLayoutPosition=function(t){if(this._setRectSize(t.element,t.rect),this.isShifting||this.dragItemCount>0){var e=this._getPackMethod();this.packer[e](t.rect)}else this.packer.pack(t.rect);return this._setMaxXY(t.rect),t.rect},u.shiftLayout=function(){this.isShifting=!0,this.layout(),delete this.isShifting},u._getPackMethod=function(){return this._getOption("horizontal")?"rowPack":"columnPack"},u._setMaxXY=function(t){this.maxX=Math.max(t.x+t.width,this.maxX),this.maxY=Math.max(t.y+t.height,this.maxY)},u._setRectSize=function(e,i){var n=t(e),o=n.outerWidth,s=n.outerHeight;(o||s)&&(o=this._applyGridGutter(o,this.columnWidth),s=this._applyGridGutter(s,this.rowHeight)),i.width=Math.min(o,this.packer.width),i.height=Math.min(s,this.packer.height)},u._applyGridGutter=function(t,e){if(!e)return t+this.gutter;e+=this.gutter;var i=t%e,n=i&&1>i?"round":"ceil";return t=Math[n](t/e)*e},u._getContainerSize=function(){return this._getOption("horizontal")?{width:this.maxX-this.gutter}:{height:this.maxY-this.gutter}},u._manageStamp=function(t){var e,n=this.getItem(t);if(n&&n.isPlacing)e=n.rect;else{var o=this._getElementOffset(t);e=new i({x:this._getOption("originLeft")?o.left:o.right,y:this._getOption("originTop")?o.top:o.bottom})}this._setRectSize(t,e),this.packer.placed(e),this._setMaxXY(e)},u.sortItemsByPosition=function(){var t=this._getOption("horizontal")?r:s;this.items.sort(t)},u.fit=function(t,e,i){var n=this.getItem(t);n&&(this.stamp(n.element),n.enablePlacing(),this.updateShiftTargets(n),e=void 0===e?n.rect.x:e,i=void 0===i?n.rect.y:i,this.shift(n,e,i),this._bindFitEvents(n),n.moveTo(n.rect.x,n.rect.y),this.shiftLayout(),this.unstamp(n.element),this.sortItemsByPosition(),n.disablePlacing())},u._bindFitEvents=function(t){function e(){n++,2==n&&i.dispatchEvent("fitComplete",null,[t])}var i=this,n=0;t.once("layout",e),this.once("layoutComplete",e)},u.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&(this.options.shiftPercentResize?this.resizeShiftPercentLayout():this.layout())},u.needsResizeLayout=function(){var e=t(this.element),i=this._getOption("horizontal")?"innerHeight":"innerWidth";return e[i]!=this.size[i]},u.resizeShiftPercentLayout=function(){var e=this._getItemsForLayout(this.items),i=this._getOption("horizontal"),n=i?"y":"x",o=i?"height":"width",s=i?"rowHeight":"columnWidth",r=i?"innerHeight":"innerWidth",a=this[s];if(a=a&&a+this.gutter){this._getMeasurements();var h=this[s]+this.gutter;e.forEach(function(t){var e=Math.round(t.rect[n]/a);t.rect[n]=e*h})}else{var u=t(this.element)[r]+this.gutter,c=this.packer[o];e.forEach(function(t){t.rect[n]=t.rect[n]/c*u})}this.shiftLayout()},u.itemDragStart=function(t){if(this.isEnabled){this.stamp(t);var e=this.getItem(t);e&&(e.enablePlacing(),e.showDropPlaceholder(),this.dragItemCount++,this.updateShiftTargets(e))}},u.updateShiftTargets=function(t){this.shiftPacker.reset(),this._getBoundingRect();var e=this._getOption("originLeft"),n=this._getOption("originTop");this.stamps.forEach(function(t){var o=this.getItem(t);if(!o||!o.isPlacing){var s=this._getElementOffset(t),r=new i({x:e?s.left:s.right,y:n?s.top:s.bottom});this._setRectSize(t,r),this.shiftPacker.placed(r)}},this);var o=this._getOption("horizontal"),s=o?"rowHeight":"columnWidth",r=o?"height":"width";this.shiftTargetKeys=[],this.shiftTargets=[];var a,h=this[s];if(h=h&&h+this.gutter){var u=Math.ceil(t.rect[r]/h),c=Math.floor((this.shiftPacker[r]+this.gutter)/h);a=(c-u)*h;for(var d=0;c>d;d++){var f=o?0:d*h,l=o?d*h:0;this._addShiftTarget(f,l,a)}}else a=this.shiftPacker[r]+this.gutter-t.rect[r],this._addShiftTarget(0,0,a);var p=this._getItemsForLayout(this.items),g=this._getPackMethod();p.forEach(function(t){var e=t.rect;this._setRectSize(t.element,e),this.shiftPacker[g](e),this._addShiftTarget(e.x,e.y,a);var i=o?e.x+e.width:e.x,n=o?e.y:e.y+e.height;if(this._addShiftTarget(i,n,a),h)for(var s=Math.round(e[r]/h),u=1;s>u;u++){var c=o?i:e.x+h*u,d=o?e.y+h*u:n;this._addShiftTarget(c,d,a)}},this)},u._addShiftTarget=function(t,e,i){var n=this._getOption("horizontal")?e:t;if(!(0!==n&&n>i)){var o=t+","+e,s=-1!=this.shiftTargetKeys.indexOf(o);s||(this.shiftTargetKeys.push(o),this.shiftTargets.push({x:t,y:e}))}},u.shift=function(t,e,i){var n,o=1/0,s={x:e,y:i};this.shiftTargets.forEach(function(t){var e=a(t,s);o>e&&(n=t,o=e)}),t.rect.x=n.x,t.rect.y=n.y};var c=120;u.itemDragMove=function(t,e,i){
function n(){s.shift(o,e,i),o.positionDropPlaceholder(),s.layout()}var o=this.isEnabled&&this.getItem(t);if(o){e-=this.size.paddingLeft,i-=this.size.paddingTop;var s=this,r=new Date;this._itemDragTime&&r-this._itemDragTime